Skip to content

[RFC 0052] Update additional GenAI fields #2532

Open
susan-shu-c wants to merge 36 commits intomainfrom
additional-gen_ai-stage-2
Open

[RFC 0052] Update additional GenAI fields #2532
susan-shu-c wants to merge 36 commits intomainfrom
additional-gen_ai-stage-2

Conversation

@susan-shu-c
Copy link
Copy Markdown
Member

@susan-shu-c susan-shu-c commented Sep 18, 2025

1. What does this PR do?

2. Which ECS fields are affected/introduced?

Field Type Description /Usage
gen_ai.system_instructions flattened The system message or instructions provided to the GenAI model separately from the chat history.
gen_ai.input.messages flattened The chat history provided to the model as an input.
gen_ai.output.messages flattened Messages returned by the model where each message represents a specific model response (choice, candidate).
gen_ai.tool.definitions flattened The list of source system tool definitions available to the GenAI agent or model.
gen_ai.tool.call.arguments flattened Parameters passed to the tool call.
gen_ai.tool.call.result flattened The result returned by the tool call (if any and if execution was successful).

Apr 23, 2026:

This RFC also renames the existing gen_ai.system field introduced in RFC 0050 to gen_ai.provider.name, following its deprecation and replacement in OTel semconv (ref). The OTel mapping relation is updated from equivalent to match. The field type, level, and allowed values are unchanged.

Field Type Change
gen_ai.system → gen_ai.provider.name keyword Renamed to align with OTel gen_ai.provider.name; description updated from "product" to "provider"

Changes based on OTel:

See changes introduced in OTel release: https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.38.0

3. Why is this change necessary?

4. Have you added/updated documentation?

YES / NO / N/A

5. Have you built ECS and committed any newly generated files?

YES / NO

6. Have you run the ECS validation tests locally?

YES / NO

7. Anything else for the reviewers?

Please see summary of feedback and concerns about flattened vs. nested here (rfcs/text)


Commit Message

@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@github-actions
Copy link
Copy Markdown
Contributor

Documentation changes preview: https://docs-v3-preview.elastic.dev/elastic/ecs/pull/2532/reference/

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 18, 2025

Comment thread docs/reference/ecs-field-reference.md
Comment thread rfcs/text/0052/gen_ai.yaml Outdated
Comment thread rfcs/text/0052/gen_ai.yaml Outdated
Copy link
Copy Markdown
Contributor

@trisch-me trisch-me left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as stage 2 is a final stage, please update all examples and generate all fields

@susan-shu-c susan-shu-c removed the stale Stale issues and pull requests label Mar 24, 2026
@susan-shu-c
Copy link
Copy Markdown
Member Author

I've updated this PR now that there have been recent changes that moves us toward using flattened fields (pending merge).

In addition, based on previous discussions, it seems that flattened is the most feasible for the use cases we've brought up (namely to be useable with ES|QL).

  1. OTel Collector ES exporter

Nested fields are not supported under passthrough namespaces like attributes.* are in the OTel ES schema.
So defining gen_ai.input.messages, gen_ai.output.messages and gen_ai.tool.definitions as nested would not be compatible with OTel ingest.
Complex attributes types are currently always mapped to flattened in the OTel Collector ES exporter.
-- @AlexanderWert

See comment.

  1. Serverless limitation for nested fields on indices

"The default setting for limiting nested fields on indices (index.mapping.nested_fields.limit) is 50. If customers try to create a new index with a higher limit, they will receive the following error: Settings [index.mapping.nested_fields.limit,index.mapping.nested_objects.limit] are not available when running in serverless mode. It's a serverless limitation that can't be overridden without Elastic support involved."
-- @Mikaayenson

See comment

  1. ES|QL queryability

At the time this RFC was drafted, neither nested nor flattened were supported in ES|QL. As of March 2026, the picture has changed significantly:

flattened is therefore the only path to ES|QL queryability in the foreseeable future.

There are tradeoffs, which I've captured here

"With flattened, it would not be possible to query for something like 'system role has a text like helpful bot', [...] the association between the role field and the parts.content field is lost."
@flash1293

See comment

"We will likely lean on _source to access nested dicts in an order preserving fashion."
@joe-desimone

See comment

This trade-off is something we will need to accept given the OTel compatibility requirement and lack of movement on nested support with ES|QL.

@trisch-me
Copy link
Copy Markdown
Contributor

Hey @susan-shu-c have you checked latest changes in OTEL for genAI fields? It might be there were some renamings or deprecations etc as we have discussed this issue long time ago. So before continuing with it I would like to be sure we are on the same page with otel definitions

@susan-shu-c
Copy link
Copy Markdown
Member Author

Hi @trisch-me all 6 fields introduced in this PR are in the newest v1.40.0 OTel with the exact same naming link

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

Vale Linting Results

Summary: 24 warnings found

⚠️ Warnings (24)
File Line Rule Message
docs/reference/ecs-gen_ai.md 23 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 23 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 23 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 23 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 23 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 23 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 23 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 23 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 23 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 25 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 25 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 29 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 39 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 42 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 44 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 47 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 47 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 47 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 47 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 47 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 47 Elastic.Latinisms Latin terms and abbreviations are a common source of confusion. Use 'for example' instead of 'e.g'.
docs/reference/ecs-gen_ai.md 47 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 47 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.
docs/reference/ecs-gen_ai.md 47 Elastic.QuotesPunctuation Place punctuation inside closing quotation marks.

The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

@susan-shu-c susan-shu-c changed the title [RFC 0052] Stage 2: Update additional GenAI fields [RFC 0052] Update additional GenAI fields Apr 15, 2026
Copy link
Copy Markdown
Member

@kgeller kgeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough investigation and write-up on the flattened vs nested decision. Before this gets to the finish line, a few things on the RFC markdown itself (rfcs/text/0052-gen_ai-additional-fields.md) that I'd like to see addressed per the RFC template:

1. Missing template sections

The ## Summary, ## Usage, and ## Scope of impact sections are currently empty or absent. Could you fill these in? Specifically:

  • Summary — what is this change and why is it being made? (2–5 sentences)
  • Usage — how will these fields be used in practice? This is one of the key questions reviewers evaluate per rfcs/PROCESS.md ("Does this change provide enough utility for its intended use cases?").
  • Scope of impact — who and what is affected by these changes? The template asks for 2–5 sentences each on ingestion, usage, and the ECS project itself.

2. Justification for flattened without leaf fields

Since this PR was opened, #2594 (prompted by #2595) added a requirement to the RFC template for any flattened or object field without defined children to justify the choice. The pieces are already here — the Concerns section explains why nested is ruled out and the YAML examples show the expected shapes — but could you add a short paragraph in ## Fields that ties them together so it's clear the requirement was considered?

3. Consider expanding the Concerns section

Not a blocker since the PR thread serves as living documentation, but a few other things came up in review that might be worth a line or two in the Concerns section:

  • Role ↔ content association loss with flattened
  • Synthetic _source cost under LogsDB

And one question: elastic/elasticsearch#144245 was closed in favor of an alternative approach, does that change anything for this proposal?

@susan-shu-c
Copy link
Copy Markdown
Member Author

@kgeller I've addressed the feedback in #2532 please let me know if I've missed something specific!

Copy link
Copy Markdown
Member

@kgeller kgeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @susan-shu-c ! This PR looks good to me.

Just an FYI since I think it's changed since your previous RFC PRs, this will still require an additional approval (we require 2 for RFCs / schema changes).

@trisch-me
Copy link
Copy Markdown
Contributor

Are we using gen_ai.system currently? it’s deprecated in semconv in favor for provider. Do we want to follow semconv or we stay with old name?

@susan-shu-c
Copy link
Copy Markdown
Member Author

susan-shu-c commented Apr 20, 2026

@trisch-me happy to add gen_ai.provider.name link [Edit: Added!]

If it's in the scope of this PR, how can I incorporate removing gen_ai.system (link), in this PR? [Edit: I've made the replacement, but looking for comments if that's the right way to replace a field.]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants